
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>微信支付样例-支付</title>
    <script type="text/javascript">
        //调用微信JS api 支付
        function jsApiCall()
        {
            WeixinJSBridge.invoke(
                'getBrandWCPayRequest', {
                    "appId" : "wxea5e64285deace17",
                    "timeStamp" : "1540436478",
                    "nonceStr" : "6909b98a7c1545419e7b21a7fd6b12f0",
                    "package" : "prepay_id=wx2511011879126820255dcd311983759867",
                    "signType" : "RSA",
                    "paySign" : "13SqFUqyR6tkfCOJSlkZO86y+5cZ/SURQv8munBUicPIjrKndM7pTxiD1z5qmKorvMap7yO00MzgzCJzLS9rFMpGra7krZryuh/L8Y69vr/vlZD/sclmMrbwDJalPTBagWVH00Rbc+t5HDMPP68O35zy0eJoCjVk466VELxuOTemn4BQaBh3rM7b0Rv1f+O6QeOKiQV+/6C0Y6glcGgN0lGlAeJ3gtZYCjJQ0Zd+Lt6wuZBJGnrHOmV3oWoK1d6OTEZprXbmPzsaoOqS71QsZs91ik3v0QJB4A6oxAmQh4ctt4eRcdmIpYOAET+4tux5zHK3Qk4mQizLS7Rfa0p7/g=="
                },
                function(res){
                    WeixinJSBridge.log(res.err_msg);
                    console.log(res);
                    alert(res.err_code+res.err_desc+res.err_msg);
                }
            );
        }

        function callpay()
        {
            if (typeof WeixinJSBridge == "undefined"){
                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }else{
                jsApiCall();
            }
        }
    </script>
</head>
<body>
<br/>
<font color="#9ACD32"><b>该笔订单支付金额为<span style="color:#f00;font-size:50px">1分</span>钱</b></font><br/><br/>
<div align="center">
    <button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer;  color:white;  font-size:16px;" type="button" onclick="callpay()" >立即支付</button>
</div>
</body>
</html>
